<style lang="scss" scoped>

  $width:330px;

  $height:240px;

  $color:#5b5b5b;

  .container{
    width: $width;
    height: $height;
    display: block;
    background: white;
    border-radius: 5px;
    float: left;
    margin: 40px;
    margin-top: 0px;
  }

  .font{
    font-family: '微软雅黑';
    color: $color;
  }



  .base-info{

    @extend  .font;

    width:100%;
    height: 35px;
    font-size: 26px;
    padding: 15px 0 0 20px;
    display: inline-block;
    border-radius: 5px;
  }

  .info-item{
    @extend .font;
    margin-top: 10px;
    height: 25px;
    line-height: 25px;
    display: block;
    float: left;
    padding-left: 10px;
    clear: both;
    font-size: 14px;
    width: 50%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &.no-clear{
      clear: none;
    }

    &.right-item{
      float: right;
      padding-right: 20px;
    }

  }



</style>

<template>
  <div class="container">
    <span class="base-info">基本信息</span>
    <div class="info-item">
      <span>创建日期:</span>
      <span class="">{{info.createTime || new Date() | toDateTime }}</span>
    </div>
    <div class="info-item">
      <span>标段名称:</span>
      <span class="">{{info.sectionName || 'xxxxx'}}</span>
    </div>
    <div class="info-item">
      <span>下达状态:</span>
      <span class="">{{info.status || '未知状态'}}</span>
    </div>
    <div class="info-item">
      <span>施工单位:</span>
      <span class="">{{info.buildOrganization || 'xxxxx'}}</span>
    </div>
    <div class="info-item no-clear right-item">
      <span>单位负责人:</span>
      <span class="">{{info.responsibility || 'xxxxx'}}</span>
    </div>
    <div class="info-item no-clear">
      <span>业主单位:</span>
      <span class="">{{info.owner || 'xxxxx'}}</span>
    </div>
    <div class="info-item no-clear right-item">
      <span>监理负责人:</span>
      <span class="">{{info.auditManager || 'xxxxx'}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    name:"BaseInfo",
    props:{
      info:{
        type:Object,
        required:true,
        default:{}
      }
    },
    filters:{
      toDateTime(input){
        var tempDate=new Date(input);

        return tempDate.toLocaleString().split(' ')[0];

      }
    }
  }
</script>
